﻿using UIOC.Attributes;
using UIOC.Tests.Services;

namespace UIOC.Tests.Objects {

    //[AutoImplement(typeof(Object))]
    public interface IUIOCSystem : IObject {

        //[AutoImplementField(typeof(IGlobalInterfaceOne))]
        IUIOCGlobalInterfaceOne GlobalInterfaceOne { get; }

        IUIOCGlobalObject GlobalObject { get; }

        int ServiceValue { get; }

        ITestService TestService { get; }

        void Plus(int value);
    }

    [Implement(typeof(IUIOCSystem))]
    public partial class UIOCSystem : Object, IUIOCSystem {

        [Autowired]
        private IUIOCGlobalObject m_GlobalObject;
        public IUIOCGlobalObject GlobalObject => m_GlobalObject;

        [Autowired]
        private IUIOCGlobalInterfaceOne m_GlobalInterfaceOne;
        public IUIOCGlobalInterfaceOne GlobalInterfaceOne => m_GlobalInterfaceOne;

        [Autowired]
        private ITestService m_TestService;
        public ITestService TestService => m_TestService;

        public int ServiceValue => m_TestService.Value;

        public void Plus(int value) {
            m_TestService.Plus(value);
        }
    }
}